package cate.game.play.skill.passive.exp;

import cate.game.attr.FightAttr;
import cate.game.play.config.PlayCfgArgs;
import cate.game.play.fighter.Fighter;
import cate.game.play.proce.action.ctx.SkillActionCtx;
import cate.game.play.skill.effect.SkillEffect;
import cate.game.play.skill.passive.PassiveHandler;

/**
 * 对非同职业的武将伤害加深和治疗加成提升15%;但对同职业的武将伤害加深和治疗加成降低7%
 */
public class 同仇敌忾PH extends PassiveHandler {


	private FightAttr 非同职业属性;

	private FightAttr 同职业属性;

	//非同职业属性=？？&同职业属性=？？
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		非同职业属性 = new FightAttr(args.get("非同职业属性"));
		同职业属性 = new FightAttr(args.get("同职业属性"));
	}

	@Override
	public void beforeSkillSettleAsActor(SkillActionCtx action, SkillEffect effect, Fighter target) {
		if (target.getJob() == skill.owner.getJob()) {
			effect.getTargetCtx(target).addActorAttr(同职业属性);
		} else {
			effect.getTargetCtx(target).addActorAttr(非同职业属性);
		}
	}
}
